package method

import (
	"server/biz"
	"server/biz/proto"
	"server/service"
)

func AccountOrderlist(md *service.Meta) (interface{}, error) {
	user_id := biz.GetCookieUserId(md.Request)
	if user_id == 0 {
		//user_id = 1
		return nil, service.NewError(400, "登录信息失效, 请在微信刷新页面")
	}
	orders := biz.GetOrders(user_id)
	var out = []*proto.Order{}
	for _, o := range orders {
		out = append(out, o.TL())
	}
	return out, nil
}
